<% layout("head.html",{title:"需求列表"}){ %>
<div>
    <form id="searchForm" hidden>
        <input type="hidden" class="page_now" name="pageNow" value="1" id="pageNumID"/>
        <input type="hidden" class="page_size" name="pageSize" value="10" id="pageSizeID"/>
        <input hidden name="isReceipt" id="is_receipt"/>
    </form>
    <div class="release_baner layui-row" id="release_baner" >
        <div class="title_div layui-col-lg4  layui-col-lg-offset3">
            <h3 class="title">
                企业发布项目需求（可不公开显示），与报名专家洽谈，<br>最终选择合适的专家进行项目合作
            </h3>
        </div>
        <div class="layui-col-lg1 layui-col-lg-offset1" style="margin-top: 75px">
            <a href="/Counselling/getCounsView" >
                <button type="button" class="el-button publish-btn el-button--primary">
                    <span>免费发布需求</span>
                </button>
            </a>
        </div>
    </div>
    <div class="stick-layout container" id="stick-layout">
        <div  class="left_div_menu" id="left_div_menu">
           <span>
                <a href="javascript:;" class="menu-item nuxt-link-active" data="1">
                    已接单
                </a><br>
               <div class="menu-divider"></div>
                <a href="javascript:;" data="0" class="menu-item nuxt-link-exact-active nuxt-link-active nuxt-link-exact-active">
                   未接单
                </a>
            </span>
        </div>
        <div class="stick-content" id="stick-content">
            <% #ajax refreshRequire:{%>
                <div class="tip-title" id="tip-title">
                    以下咨询问题，正在寻找合适达者
                </div>
                <% if(isNotEmpty(results.data.list)){%>
                    <% for(entityData in results.data.list){%>
                        <a href="/Counselling/queryCounseEntityModelAndView/${entityData.id}" class="demand-item" data="">
                            <div class="item-inner">
                                <div class="inner-header">
                                    <h3>${entityData.title!}</h3>
                                    <span class="city">${entityData.isReceipt=='0'?'未接单':'已接单'}</span>
                                    <span class="budget-wrapper">
                                        金额
                                        <span class="budget">${entityData.payMoney!}元</span>
                                    </span>
                                </div><br>
                                <div class="inner-desc">
                                    ${entityData.content!}
                                </div>
                                <div class="inner-service">
                                    <i class="el-icon-icn_scene"></i>
                                    服务说明：大V需要提前预约。
                                </div>
                                <div class="inner-cycle">
                                    <i class="icon"></i>
                                    <span class="text">${entityData.domain!}</span>
                                </div>
                                <div class="inner-footer">
                                    <span class="applicant">达者类型：${entityData.grade!}</span>
                                    <span class="deadline fr">时间：${entityData.createTime!,dateFormat="yyyy-MM-dd HH:mm:ss"}</span>
                                </div>
                            </div>
                        </a>
                    <%}%>
                <%}else{%>
                    <div style="text-align: center;background-color: #fff;font-weight: bolder">${results!}暂无您查找的数据</div>
                <%}%>
                <div id="lay_page" style="text-align: center;background-color: #fff"></div>
                <script type="text/javascript">
                    //搜索刷新分页，否则分页会保留上次记录,导致无数据是分页不为0。
                    if (!isUndefined(typeof laypage)) {
                        layPageFunction(laypage, "lay_page", '${results.data.page.pageSize!}', '${results.data.page.pageNow!}',
                            '${results.data.page.totalCount!}', "searchForm", "/Counselling/refreshAjax?refreshName=refreshRequire",
                            "stick-content", "pageNumID", "pageSizeID", false);
                    }
                </script>
            <%}%>
        </div>
    </div>
</div>
<script type="text/javascript">

    layui.use(['laypage', 'jquery'], function () {
        laypage = layui.laypage;
        $ = jQuery = layui.$;
        //初始化页面数据
        $layPageFunction(laypage,false);
        //需求列表左侧订单状态搜索
        $(".left_div_menu a").click(function () {
            $("#is_receipt").val($(this).attr('data'));
            $layPageFunction(laypage,true);
        });

    });
    //需求列表左侧订单区域动态css设置
    dynamiCSS('stick-content','left_div_menu',120);
    function $layPageFunction($laypage,is_once){
        layPageFunction($laypage, "lay_page", '${results.data.page.pageSize!}', '${results.data.page.pageNow!}',
            '${results.data.page.totalCount!}', "searchForm", "/Counselling/refreshAjax?refreshName=refreshRequire",
            "stick-content", "pageNumID", "pageSizeID", is_once);
    }
</script>

<%}%>